/*
ONEGAME
Copyright (C) 2009  Pablo Caballero

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package one.main;

import java.awt.Window;
import swing.JCenteredDialog;

/**
 * "About program" dialog
 * @author Pablo Caballero
 * @version 1.0 23-jun-2009
 */
public class AboutDlg extends JCenteredDialog {

	/** Creates new form AboutDlg */
	public AboutDlg(Window parent) {
		super(parent);
		initComponents();
	}

	/**
	 * Hides the window
	 */
	private void close() {
		setVisible(false);
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlBackground = new javax.swing.JPanel();
        pnlBottom = new javax.swing.JPanel();
        btnClose = new javax.swing.JButton();
        lblTitle = new javax.swing.JLabel();
        lblIcon = new javax.swing.JLabel();
        lblVersion = new javax.swing.JLabel();
        lblImage = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("one/language/labels"); // NOI18N
        setTitle(bundle.getString("FRMABOUT_TITLE")); // NOI18N
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        pnlBackground.setBackground(new java.awt.Color(255, 255, 255));
        pnlBackground.setLayout(null);

        pnlBottom.setBackground(new java.awt.Color(102, 102, 102));
        pnlBottom.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        btnClose.setText(bundle.getString("CLOSE_BUTTON")); // NOI18N
        btnClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCloseActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlBottomLayout = new javax.swing.GroupLayout(pnlBottom);
        pnlBottom.setLayout(pnlBottomLayout);
        pnlBottomLayout.setHorizontalGroup(
            pnlBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBottomLayout.createSequentialGroup()
                .addGap(77, 77, 77)
                .addComponent(btnClose)
                .addContainerGap(76, Short.MAX_VALUE))
        );
        pnlBottomLayout.setVerticalGroup(
            pnlBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBottomLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnClose)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pnlBackground.add(pnlBottom);
        pnlBottom.setBounds(0, 250, 216, 49);

        lblTitle.setFont(new java.awt.Font("Verdana", 1, 48));
        lblTitle.setForeground(new java.awt.Color(0, 128, 51));
        lblTitle.setText(bundle.getString("APP_TITLE")); // NOI18N
        pnlBackground.add(lblTitle);
        lblTitle.setBounds(0, 190, 115, 60);

        lblIcon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/one/image/lgplv3-88x31.png"))); // NOI18N
        pnlBackground.add(lblIcon);
        lblIcon.setBounds(10, 10, 88, 31);

        lblVersion.setFont(new java.awt.Font("Verdana", 1, 12));
        lblVersion.setForeground(new java.awt.Color(153, 153, 153));
        lblVersion.setText(bundle.getString("APP_VERSION")); // NOI18N
        pnlBackground.add(lblVersion);
        lblVersion.setBounds(120, 230, 75, 16);

        lblImage.setIcon(new javax.swing.ImageIcon(getClass().getResource("/one/image/fern_220x220.png"))); // NOI18N
        pnlBackground.add(lblImage);
        lblImage.setBounds(0, 0, 220, 210);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(pnlBackground, javax.swing.GroupLayout.PREFERRED_SIZE, 216, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(pnlBackground, javax.swing.GroupLayout.PREFERRED_SIZE, 297, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

	private void btnCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCloseActionPerformed
		close();
}//GEN-LAST:event_btnCloseActionPerformed

	private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
		close();
	}//GEN-LAST:event_formWindowClosing

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnClose;
    private javax.swing.JLabel lblIcon;
    private javax.swing.JLabel lblImage;
    private javax.swing.JLabel lblTitle;
    private javax.swing.JLabel lblVersion;
    private javax.swing.JPanel pnlBackground;
    private javax.swing.JPanel pnlBottom;
    // End of variables declaration//GEN-END:variables
}
